﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Camc.Quality.Migrations
{
    public partial class add_inventory : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "CancellingRecords",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    CancellingStocksId = table.Column<Guid>(nullable: false),
                    StoreStockContentId = table.Column<Guid>(nullable: false),
                    ReleaseOrder = table.Column<string>(nullable: true),
                    QualifiedNumber = table.Column<string>(nullable: true),
                    ProductNumber = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CancellingRecords", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "InventoryDetails",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    StorePutId = table.Column<Guid>(nullable: false),
                    InventoryId = table.Column<Guid>(nullable: false),
                    StroeName = table.Column<string>(nullable: true),
                    BinLocation = table.Column<string>(nullable: true),
                    ProductDrawingNo = table.Column<string>(nullable: true),
                    ProductName = table.Column<string>(nullable: true),
                    Module = table.Column<string>(nullable: true),
                    MaterialsNodeDesc = table.Column<string>(nullable: true),
                    MaterialsNodeId = table.Column<Guid>(nullable: false),
                    MaterialsContentId = table.Column<Guid>(nullable: false),
                    MaterialsContentDsec = table.Column<string>(nullable: true),
                    MaterialsPropertyDesc = table.Column<string>(nullable: true),
                    MaterialsProperty = table.Column<int>(nullable: false),
                    QualifiedNumber = table.Column<string>(nullable: true),
                    ReleaseOrder = table.Column<string>(nullable: true),
                    StoreQuantity = table.Column<int>(nullable: false),
                    StoreProductNumber = table.Column<string>(nullable: true),
                    InventoryNo = table.Column<int>(nullable: false),
                    InventoryPartNo = table.Column<string>(nullable: true),
                    Remark = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_InventoryDetails", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "InventoryStores",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    InventoryNo = table.Column<string>(nullable: true),
                    StoreId = table.Column<Guid>(nullable: true),
                    StroeName = table.Column<string>(nullable: true),
                    MaterialsNodeId = table.Column<Guid>(nullable: false),
                    InventoryStartTime = table.Column<DateTime>(nullable: true),
                    InventoryEndTime = table.Column<DateTime>(nullable: true),
                    InventoryState = table.Column<int>(nullable: false),
                    InventoryPeopleId = table.Column<long>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_InventoryStores", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CancellingRecords");

            migrationBuilder.DropTable(
                name: "InventoryDetails");

            migrationBuilder.DropTable(
                name: "InventoryStores");
        }
    }
}
